package com.jb.demo.map;

import com.jb.demo.map.domain.AddressImpl;
import com.jb.demo.map.domain.House;
import com.jb.map.domain.Address;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;


public class AddressService {
    private List addresses = new ArrayList();
    private int selected = 0;
    public AddressService() {
        addresses.add(new AddressImpl(37.234d,-122.14d
                      , new House(
                            "daddy's  house",
                            1000000f, 
                            4, 
                            2.5f,
                            2134, 
                            2,
                            "http://us.f3.yahoofs.com/class/000549530520/_tn__e91d6db145bbce7306d722f74c6f616d_0_u2.jpg?cf_L5gyCaqOjJ_NF")
                       ));
        addresses.add(new AddressImpl(37.434d,-122.14d
                      , new House(
                            "mommy's house",
                            800000f, 
                            3, 
                            1.5f,
                            1634, 
                            1,
                            "http://us.f3.yahoofs.com/class/001006776865/_tn__c55aa615c797d46953c77de9cde5363f_0_u2.jpg?cf_L5gyCqCgrIRsZ")
                       ));
        addresses.add(new AddressImpl(37.634d,-122.12d
                      , new House(
                            "sarah's house",
                            400000f, 
                            2, 
                            1.5f,
                            1134, 
                            1,
                            "http://us.f3.yahoofs.com/class/002031222593/_tn__da98f8094c036b047fb75468070e0abc_0_u5.jpg?cf_L5gyCKKlUv6sl")
                       ));
    }
    
    public Collection getAddresses() {
        return addresses;
    }
    
    public Address getAddress() {
        return (Address)addresses.get(selected);
    }

    public void setSelected(int param) {
        this.selected = param;
    }

    public int getSelected() {
        return selected;
    }
}
